<?php


namespace api\modules\v1\controllers\statistics;

use Yii;
use api\controllers\OnAuthController;
use yii\web\HttpException;

class CallbackReportController extends OnAuthController
{
    /**
     * @var string
     */
    public $modelClass = '';

    /**
     * 经营-预览列表
     *
     * @return array|\yii\db\ActiveRecord[]
     * @throws HttpException
     * @author chenyuebin
     */
    public function actionList()
    {
        $projectId = $this->projectId;
        $params = Yii::$app->request->get();

        $data = Yii::$app->services->statisticsCallbackReport->reportCallback($projectId, $params);
        return $data;
    }

    /**
     * 经营-预览列表-详情列表
     *
     * @return array|\yii\db\ActiveRecord[]
     * @author chenyuebin
     */
    public function actionReportPatientList()
    {
        $params = Yii::$app->request->get();
        $page = (int)Yii::$app->request->get('page', 1);
        $pageSize = (int)Yii::$app->request->get('pageSize', 15);
        $params['project_id'] = $this->projectId;
        $data = Yii::$app->services->statisticsCallbackReport->reportCallbackInfo($params, $page, $pageSize);
        return $data;
    }
}